# 1. Prepare repo.
cd /tmp/OpenPCDet/
git pull
#git branch -a | grep hmm
#git checkout -b bus_train_hmmAug origin/bus_train_hmmAug


# 2. Get IP address
# ip=$(hostname -i); if [ "$ip" = "127.0.1.1" ]; then ip addr show dev eth0 | awk '/inet / {split($2, a, "/"); print a[1]}'; else echo "$ip"; fi

ip=$(hostname -i)

if [[ "$ip" == "127.0.1.1" || "$ip" == "127.0.0.1" ]]; then
    ip=$(ip addr show dev eth0 | awk '/inet / {split($2, a, "/"); print a[1]}')
    if [ $? -ne 0 ]; then
        apt-get install -y iproute2
        ip=$(ip addr show dev eth0 | awk '/inet / {split($2, a, "/"); print a[1]}')
    fi
else
    echo "$ip"
fi